Goal
- Use GitHub’s branches feature to manage changes in a shared repository where multiple parties have write privileges.
- Use RStudio to edit a branch, commit and push it to GitHub.
Scenario
- You’re sharing a code base with a colleague and want to make an edit to one or more files
- You share edit privileges on the repo, but you don’t want to ruin your colleague’s hard work by making commits directly to the master branch.
Step 1: Make your own code branch
- Go to the repo on GitHub
- Create a new branch
Step 2: Pull repo from RStudio
- Go to RStudio
- Open the project for this repo
- Pull from GitHub
Step 3: Switch to the new branch and edit
- Switch to the new branch
- Edit one or more files in the new branch
Step 4: Commit your changes and push them back to GitHub
- Commit your changes
- Push to GitHub
Step 5: Create pull request on GitHub